import java.util.*;
import java.io.*;

class a2{
    public static void main(String[] args) {
       
        InputStreamReader isr=new InputStreamReader(System.in);
        BufferedReader bf=new BufferedReader(isr);
        String s=null;
        try {
            s=bf.readLine().toString(); 
            String ss[]=s.split(",");
            ss[0]=ss[0].replace("\"","");
            ss[1]=ss[1].replace("\"","");
            String sus[]=ss[1].split("\\.");
            String ans=ss[0];
            int start=0,end=ans.length();
            for(String x:sus){  
                //System.out.println(x);
                start=ans.indexOf("<"+x+">");
                end=ans.lastIndexOf("</"+x+">");

                if(start!=-1 && end!=-1){
                    start=start+x.length()+2;
                    ans=ans.substring(start,end);
                }
            }
            
            if(start>end||start==-1||end==-1){
                System.out.println("");
                return ;
            }
            System.out.println(ans);
        } catch (Exception e) {
           
        }
    }

}